﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RobotBattle2.Interpreter;
using RobotBattle2.Scripting;
using System.Diagnostics;
using RobotBattle2.Rsl2;
using RobotBattle2.Runtime;

namespace Test.RobotBattle.Interpreter {
	public class Program {
		static void Main(string[] args) {
			var parser = new Rsl2Parser();
			var script = parser.LoadScript("Test1.rsl");
			script.Dump(Console.Out);
			Debug.Listeners.Add(new ConsoleTraceListener());
			var runner = new InterpreterScriptRunner { Script = script };
			runner.GlobalScope.DefineGlobal("x").Value = 5.0m;
			runner.Initialize();
			Debug.Assert(runner.GlobalScope.Get("x").Value.AsNumber() == 5);
			Console.WriteLine("[Press any key to exit]");
			Console.ReadKey();
		}
	}
}
